a = input()
i = 0
while i < len(a):
    if a[i] == "(":
        if a[i+1] == ")" or a[i+2] == ")":
            print("True")
            break
        else:
            print("False")
            break
    elif a[i] == "[":
        if a[i+1] == "]" or a[i+2] == "]":
            print("True")
            break
        else:
            print("False")
            break
    elif a[i] == "{":
        if a[i+1] == "}" or a[i+2] == "}":
            print("True")
            break
        else:
            print("False")
            break
    elif a[i] == "<":
        if a[i+1] == ">" or a[i+2] == ">":
            print("True")
            break
        else:
            print("False")
            break
    elif a[i] == " ":
        if a[i+1] == " " or a[i+2] == " ":
            print("True")
            break
        else:
            print("False")
            break
    else:
        print("False")
    i =+ 1